<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>default</title>
    <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
    <script>
      function a1(){
        $.ajax({
          url:"${pageContext.request.contextPath}/a1",
          data:{'name':$("#txtName").val()},
          success:function (data,status){
            alert("data: " + data + "\n" + "status: " + status);
          }
              })
      }
    </script>
  </head>



  <body>

<%-- onblur : 失去焦点触发事件 --%>
  用户名:<input type="text" id="txtName" onblur="a1()"/>

  </body>

</html>
